/**
 * ssr服务端渲染
 * 2019-12-16 15:30
 * author @creatnl
 * 
 * 待开发功能：
 * 1. 服务端ssr路由注册
 * 2. ssr路由规则校验模块
 * 3. 数据渲染
 */

let minimatch = require("minimatch")

const SSR_ROUTERS = require('../config/ssr-router.json')

export class SSR {
  static val: string = '1'

  static matchRoute (filepath): Boolean {

    for (const rule of SSR_ROUTERS.path) {

      if (minimatch(filepath, rule)) {
        return true
      }

    }

    return false
  }
}
